From 20f5aae2487c46aa51a2b304ff229a4d3763e377 Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Sat, 24 Sep 2022 23:24:05 +0200
Subject: [PATCH 12/18] compiler-rt: HACK: always compile in gcc_personality_v0

Looks like HAVE_UNWIND_H is not accounted for when doing the
runtimes build, but this is the only place where it's checked.

Unconditionally compile it in because some things use it.
---
 compiler-rt/lib/builtins/CMakeLists.txt       | 10 ++++------
 compiler-rt/lib/builtins/gcc_personality_v0.c |  2 +-
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index d1aeb5392..5e568af84 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -224,12 +224,10 @@ if(APPLE)
   )
 endif()
 
-if (HAVE_UNWIND_H)
-  set(GENERIC_SOURCES
-    ${GENERIC_SOURCES}
-    gcc_personality_v0.c
-  )
-endif ()
+set(GENERIC_SOURCES
+  ${GENERIC_SOURCES}
+  gcc_personality_v0.c
+)
 
 if (NOT FUCHSIA)
   set(GENERIC_SOURCES
diff --git a/compiler-rt/lib/builtins/gcc_personality_v0.c b/compiler-rt/lib/builtins/gcc_personality_v0.c
index 58fd7ceb5..ce5f0d277 100644
--- a/compiler-rt/lib/builtins/gcc_personality_v0.c
+++ b/compiler-rt/lib/builtins/gcc_personality_v0.c
@@ -9,7 +9,7 @@
 #include "int_lib.h"
 #include <stddef.h>
 
-#include <unwind.h>
+#include "../../../libunwind/include/unwind.h"
 #if defined(__arm__) && !defined(__ARM_DWARF_EH__) &&                          \
     !defined(__USING_SJLJ_EXCEPTIONS__)
 // When building with older compilers (e.g. clang <3.9), it is possible that we
-- 
2.37.3

